home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Creative Review 28
/
Creative-Review-CD-ROM-28.iso
/
pc
/
kungfu
/
assets
/
game.dir
/
00054_Script_move class
< prev
next >
Wrap
Text File
|
1997-08-08
|
2KB
|
107 lines
-- move class method
-- --------------------------------------------------
property moveflag
property targetloc
property startloc
property stepvector
property stepcount
property totalsteps
property callback
property timeelapsed
property gear
property ancestor
-- ==================================================
-- new method
-- --------------------------------------------------
on new me, props
minit me, props
return me
end mnew
-- ==================================================
-- minit method
-- --------------------------------------------------
on minit me, props
-- put "in minit move"
set ancestor = new ( script "draw class" , props )
set gear = 1000
set totalsteps = 42
-- put "out minit move"
end minit
-- ==================================================
-- mstartmove method
-- --------------------------------------------------
on mstartmove me, props
-- put "in mstartmove move"
list2object ( props, me )
set moveflag = true
set totalvector = targetloc - startloc
set stepvector = totalvector / totalsteps
set stepcount = 0
msetloc me, startloc
-- put "out mstartmove move"
end mstartmove
-- ==================================================
-- mfinishmove method
-- --------------------------------------------------
on mfinishmove me
-- put "in mfinishmove move"
msetloc me, targetloc
mdraw me
set moveflag = false
mcallback callback
-- put "out mfinishmove move"
end mfinishmove
-- ==================================================
-- mdotask method
-- --------------------------------------------------
on mdotask me
-- put "in mdotask move", timeelapsed
set stepcount = stepcount + 1
if stepcount > totalsteps then
mfinishmove me
else
mmove me, stepvector
mdraw me
end if
-- put "out mdotask move"
end mdotask